﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LTHD_Web
{
    public partial class Capnhatdiadiem : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string newupdate = Request["newaddress"];
            int placeid = int.Parse(Request["id"]);
            int type = int.Parse(Request["type"].ToString());
            lb_content.Text = newupdate + placeid + type;


            dbDataContext db = new dbDataContext();
            var query = from n in db.diadiems where n.id == placeid select n;

            if (type == 1)
                query.First().diachi = newupdate;

            if (type == 2)
                query.First().chitiet = newupdate;

            db.SubmitChanges();

        }
    }
}